<?php
/**
 *author:栗超
 *address:2788547340@qq.com
 * 2016/9/4 15:31
 */
namespace Home\Controller;
use Common\Model\Address;
use Hdphp\Controller\Controller;

class AddressController extends Controller{
    private $model;
    public function __init(){
        $this->model=new Address();
    }
    public function add(){
//        p(Q('post.'));
//        $this->model->where('')
        $add=$this->model->store();
//        p($add);die;
        echo json_encode($add);
    }
    public function del(){
        $aid=Q('get.aid',0,'intval');
//        p($aid);
//        $this->model->where("aid={$aid}")->delete();
        $this->model->where("aid={$aid}")->delete();
            View::success('删除成功','From/index');
    }
}